package com.hutiao.snowhb.actions.admin;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

import com.hutiao.snowhb.common.WeixinUtil;
import com.opensymphony.xwork2.ActionSupport;

@Namespace("/admin")
public class SystemMenuAction extends ActionSupport {

	private static final long serialVersionUID = 6203654310240626983L;
	
	private String strMenu;
	
	private String strRet;

	public String getStrMenu() {
		return strMenu;
	}

	public void setStrMenu(String strMenu) {
		this.strMenu = strMenu;
	}

	public String getStrRet() {
		return strRet;
	}

	public void setStrRet(String strRet) {
		this.strRet = strRet;
	}
	
	@Action(value="system_menu")
	public String systemMenu() {

		return SUCCESS;
	}
	
	@Action(value="create_menu",results = {@Result(name="success", type="chain", location="systeminfo")})
	public String createMenu() throws Exception {
		
		this.strRet = WeixinUtil.createMenu(this.strMenu);
		
		return SUCCESS;
	}
	
	@Action(value="system_menukey")
	public String systemMenuKeyInfo() {

		return SUCCESS;
	}

}
